package uz.rt.linac;

public class Tray extends LinacComponent
{
// ------------------------------ FIELDS ------------------------------

    private double attenuationFactor;

// --------------------------- CONSTRUCTORS ---------------------------

    public Tray()
    {
        setAttenuationFactor(1.0);
    }

    public Tray(final double attenuationFactor)
    {
        setAttenuationFactor(attenuationFactor);
    }

// --------------------- GETTER / SETTER METHODS ---------------------

    public double getAttenuationFactor()
    {
        return attenuationFactor;
    }

    public void setAttenuationFactor(double attenuationFactor)
    {
        this.attenuationFactor = attenuationFactor;
    }

// ------------------------ CANONICAL METHODS ------------------------

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (!(o instanceof Tray)) return false;

        Tray tray = (Tray) o;

        return Double.compare(tray.attenuationFactor, attenuationFactor) == 0 && distanceToSource
                .compareTo(tray.getDistanceToSource()) == 0;

    }

    @Override
    public int hashCode()
    {
        long temp = attenuationFactor != +0.0d ? Double.doubleToLongBits(attenuationFactor) : 0L;
        return (int) (temp ^ (temp >>> 32));
    }

// ------------------------ INTERFACE METHODS ------------------------


// --------------------- Interface Comparable ---------------------

}
